<template>
  <x-border title="会员管理" icon="el-icon-setting" type="accent" v-if="viewModel">
    <div class="user-management-a" v-loading="isLoading">
      <div class="user-management_left">
        <left :viewModel="viewModel"></left>
      </div>
      <div class="user-management_right">
        <right :viewModel="viewModel"></right>
      </div>
    </div>
  </x-border>
</template>
<script>
  import Left from './widgets/left.vue'
  import Right from './widgets/right.vue'
  import ala from 'ala'
export default {
    props: {
      widgetData: {}
    },
    components: {
      Left,
      Right
    },
    data () {
      return {
        viewModel: [],
        isLoading: true
      }
    },
    mounted () {
      this.init()
      window.addEventListener('scroll', this.scrollInit,true)
    },
    methods: {
      async init () {
        var data = {
          id: this.$route.query.id
        }
        var response = await this.$ala.httpGet('api/UserAdmin/Edit', data)
        if (response) {
          this.viewModel = response
        }
        this.isLoading = false
      },
      async scrollInit () {
        if (this.viewModel.length === 0) {
          this.init()
        }
      }
    }
  }
</script>
<style rel="stylesheet/scss" lang="scss">
  @import "./widgets/style.scss";
</style>


